<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::transport::struc::Channel_base::Serialize_via_app_shm Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Full implementation reference.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport.html">transport</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport_1_1struc.html">struc</a></li><li class="navelem"><a class="el" href="classipc_1_1transport_1_1struc_1_1Channel__base.html">Channel_base</a></li><li class="navelem"><a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__app__shm.html">Serialize_via_app_shm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">ipc::transport::struc::Channel_base::Serialize_via_app_shm Struct Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Similar to <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html" title="Tag type for ctor selection: Backing RAM for serialization comes from a given session::Session&#39;s SHM ...">Serialize_via_session_shm</a> but assumes per-app-scope SHM-arena (as opposed to per-session-scope) at compile time.  
 <a href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__app__shm.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="channel__base_8hpp_source.html">channel_base.hpp</a>&gt;</code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Similar to <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html" title="Tag type for ctor selection: Backing RAM for serialization comes from a given session::Session&#39;s SHM ...">Serialize_via_session_shm</a> but assumes per-app-scope SHM-arena (as opposed to per-session-scope) at compile time. </p>
<p >More specifically: The source arena for our serialization comes from the <code>Session</code> impl supplied nearby in the ctor call; specifically its <code>.app_shm()</code> arena. As for deserialization on our end: we will be able to handle any objects sent from the other side, period.</p>
<p ><code>Session</code> must be specifically <em>not</em> of the <code>"ipc::session::shm::arena_lend::*::Server_session"</code> variety; <code>"ipc::session::shm::arena_lend::*::Client_session"</code> cannot be used (any attempt will not compile). This is because the latter lacks <code>.app_shm()</code> due to the nature of arena-lending SHM providers, where each process allocates from an arena it maintains for itself (and from which the other process can only borrow objects). Some more notes on this are below in this doc header.</p>
<p >For concision, and to compile successfully, use the <a class="el" href="classipc_1_1transport_1_1struc_1_1Channel.html" title="Owning and wrapping a pre-connected transport::Channel peer (an endpoint of an established channel ov...">struc::Channel</a> alias class template: <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#ac543b500a85f556564e592cbbefb6185" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::classic::Channel</a> or <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#ab68a69ad42d97d754f4e77c8cadd3a5e" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::arena_lend::jemalloc::Channel</a>.</p>
<h2>Relative benefits/limitations </h2>
<h3>As compared to <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__heap.html" title="Tag type for ctor selection: Backing memory for serialization comes from fixed-size segment allocatio...">Serialize_via_heap</a></h3>
<p >Essentially they are the inverse of those of <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__heap.html" title="Tag type for ctor selection: Backing memory for serialization comes from fixed-size segment allocatio...">Serialize_via_heap</a> above.</p>
<h3><a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1classic.html#ac543b500a85f556564e592cbbefb6185" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::classic::Channel</a> versus <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#ab68a69ad42d97d754f4e77c8cadd3a5e" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::arena_lend::jemalloc::Channel</a></h3>
<p >See <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html" title="Tag type for ctor selection: Backing RAM for serialization comes from a given session::Session&#39;s SHM ...">Serialize_via_session_shm</a>.</p>
<p >In addition there is a <em>possibly</em> crucial difference in capabilities, depending on one's app needs (it is mentioned above in this doc header):</p><ul>
<li>With SHM-jemalloc (via <a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm_1_1arena__lend_1_1jemalloc.html#ab68a69ad42d97d754f4e77c8cadd3a5e" title="Convenience alias: Use this when constructing a struc::Channel with tag Channel_base::S_SERIALIZE_VIA...">shm::arena_lend::jemalloc::Channel</a>), it is <em>not</em> possible to use this per-app-scope mode on the client side; only per-session scope is available (this is a consequence of its asymmetrical, safety-oriented design as of this writing). On the <code>Server_session</code> end it is possible to create out-messages in either scope however.<ul>
<li>An attempt to use this per-app-scope mode with a <code><a class="el" href="namespaceipc_1_1session_1_1shm_1_1arena__lend_1_1jemalloc.html#a837b4566cb2a734eb0ba58f285d084fe" title="This is to session::Client_session what shm::arena_lend::jemalloc::Server_session is to session::Serv...">session::shm::arena_lend::jemalloc::Client_session</a></code> will be caught at compile time (it... won't compile).</li>
<li>Specifically, then, with SHM-jemalloc, in session-server use either <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__app__shm.html" title="Similar to Serialize_via_session_shm but assumes per-app-scope SHM-arena (as opposed to per-session-s...">Serialize_via_app_shm</a> or <a class="el" href="structipc_1_1transport_1_1struc_1_1Channel__base_1_1Serialize__via__session__shm.html" title="Tag type for ctor selection: Backing RAM for serialization comes from a given session::Session&#39;s SHM ...">Serialize_via_session_shm</a>; in the opposing session-client use the latter only. Deserialization will work on both sides; but serialization (building/sending) will work only for session-scope resources (again, attempt to do otherwise will not compile). </li>
</ul>
</li>
</ul>

<p class="definition">Definition at line <a class="el" href="channel__base_8hpp_source.html#l00152">152</a> of file <a class="el" href="channel__base_8hpp_source.html">channel_base.hpp</a>.</p>
</div><hr/>The documentation for this struct was generated from the following file:<ul>
<li>transport/struc/<a class="el" href="channel__base_8hpp_source.html">channel_base.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 11 2025 20:02:27 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
